home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / catD / itimeout.z / itimeout
Encoding:
Text File  |  2002-10-03  |  7.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333))))                                                      iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt, _ffff_aaaa_ssss_tttt______iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt - execute a function after a (possibly high
  10.      resolution) delay
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  15.  
  16.      _tttt_oooo_iiii_dddd______tttt _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt_((((_vvvv_oooo_iiii_dddd _((((_****_f_u_n_c_))))_((((_))))_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_,,,, _llll_oooo_nnnn_gggg _t_i_c_k_s_,,,,
  17.                            _pppp_llll______tttt _p_l_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_2_...._...._...._))))_;;;;
  18.  
  19.      _tttt_oooo_iiii_dddd______tttt _ffff_aaaa_ssss_tttt______iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt_((((_vvvv_oooo_iiii_dddd _((((_****_f_u_n_c_))))_((((_))))_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_,,,, _llll_oooo_nnnn_gggg _f_a_s_t__t_i_c_k_s_,,,,
  20.                            _pppp_llll______tttt _p_l_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_2_...._...._...._))))_;;;;
  21.  
  22.  
  23.    AAAArrrrgggguuuummmmeeeennnnttttssss
  24.      _f_u_n_c      Function to execute when the time increment expires.
  25.  
  26.      _a_r_g       First or only argument to the function.
  27.  
  28.      _a_r_g_2...   Optional, additional arguments to the function.
  29.  
  30.      _t_i_c_k_s     Number of (fast or normal) clock ticks to wait before the
  31.                function is called.
  32.  
  33.      _p_l        The interrupt priority level at which the function will be
  34.                called.
  35.  
  36. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  37.      These two functions are nearly identical, the difference being which
  38.      clock is used. _i_t_i_m_e_o_u_t schedules the function specified by _f_u_n_c to be
  39.      called after the time interval specified by _t_i_c_k_s, while _f_a_s_t__i_t_i_m_e_o_u_t
  40.      schedules the function specified by _f_u_n_c to be called after the the
  41.      number of fast clock ticks specified by _f_a_s_t__t_i_c_k_s.  The resolution of
  42.      the fast clock varies with system type, and with local setup, because it
  43.      is a tuneable value.  It is typically near one millisecond.  See the
  44.      function _f_a_s_t_h_z_t_o(D3) for a standard way to convert from a timeval to
  45.      fast ticks.
  46.  
  47.      Both functions call the function at the interrupt priority level
  48.      specified by _p_l.  The first argument to _f_u_n_c is _a_r_g.  If additional
  49.      arguments are passed following _p_l (varargs), they also are are passed to
  50.      _f_u_n_c.
  51.  
  52.      The call returns immediately without waiting for the specified function
  53.      to execute.
  54.  
  55.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  56.      If the function specified by _f_u_n_c is successfully scheduled, _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt
  57.      returns a non-zero value that can be passed to _uuuu_nnnn_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt to cancel the
  58.      request.  If the function could not be scheduled, _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt returns a
  59.      value of 0.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333))))                                                      iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333))))
  71.  
  72.  
  73.  
  74. UUUUSSSSAAAAGGGGEEEE
  75.      _p_l must specify a priority level greater than or equal to _p_l_t_i_m_e_o_u_t.
  76.      Identifiers for priority levels are declared in _s_y_s/_d_d_i._h; _p_l_h_i is the
  77.      typical value to pass.
  78.  
  79.      Note that no matter what value is given for _p_l, other CPUs can be
  80.      executing kernel code concurrently with the execution of _f_u_n_c, including
  81.      other instances of the same driver that scheduled _f_u_n_c and even other
  82.      instances of _f_u_n_c itself. Hence it is essential to use locking to protect
  83.      critical data.
  84.  
  85.      The _t_i_c_k_s argument specifies the number of tick interrupts to pass before
  86.      the function is called.  A _t_i_c_k_s value of 0 is treated as if it were 1.
  87.      After the specified number of ticks have been counted, the call to _f_u_n_c
  88.      is deferred until the processor is at base level.
  89.  
  90.      The length of time before the function is called is not guaranteed to be
  91.      exactly equal to the requested time, but will be at least _t_i_c_k_s-1 clock
  92.      ticks in length.
  93.  
  94.      When called, _f_u_n_c may not lower the priority level below _p_l.
  95.  
  96.      If _i_t_i_m_e_o_u_t is called holding a lock that is claimed by _f_u_n_c, the caller
  97.      must hold the lock at a processor level greater than the base processor
  98.      level.
  99.  
  100.      Loadable drivers must use _u_n_t_i_m_e_o_u_t() to cancel any pending timeout
  101.      functions before unloading; otherwise a kernel panic can result when the
  102.      no-longer-loaded function is called.  A driver that is deallocating a
  103.      data structure must be careful to cancel any pending timeout function
  104.      that refers to the data structure.
  105.  
  106.    LLLLeeeevvvveeeellll
  107.      Base or Interrupt.
  108.  
  109.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  110.      Driver-defined basic locks, read/write locks, and sleep locks may be held
  111.      across calls to this function.
  112.  
  113.    EEEExxxxaaaammmmpppplllleeeessss
  114.      See _cccc_oooo_pppp_yyyy_bbbb(D3) for an example of _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt.
  115.  
  116. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  117.      LOCK_ALLOC(D3), dtimeout(D3), fasthzto(D3), untimeout(D3).
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.